Multicast joins are very different from the unicast routes that you see in the route command. The route command shows unicast destinations that your computer can send to.
创建UDP socket,绑定INADDR_ANY、约定的端口,加入组播组,接收即可。 有些不同,加入组播组时若依然使用INADDR_ANY,则内核默认使用网络设备列表的第一个设备,有可能并不是该局域网。 因此,需要将INADDR_ANY替换为LOCAL_IP,即本设备与其他互相发现的设备所在局域网的网卡IP。 以上所有源码可在 https://github.com/captainwong/mcast 获取。 How to fix the global broadcast address (255.255